/*
 *
 * Copyright (C) 2022 Zealcomm Inc. (https://www.zealcomm.com)
 *
 */

#ifndef IRTC_BASE_OBJC_IRTCRECORDER_H_
#define IRTC_BASE_OBJC_IRTCRECORDER_H_

#import <Foundation/Foundation.h>
#import <IRTC/IRTCMacros.h>
#import "IRTC/IRTCLocalStream.h"
#import "IRTC/IRTCRemoteMixedStream.h"
#import "IRTC/IRTCRemoteStream.h"
NS_ASSUME_NONNULL_BEGIN

IRTC_OBJC_EXPORT
@interface IRTCRecorder : NSObject

- (instancetype)init;

- (instancetype)initWithWidth:(int)width height:(int)height;

/**
  @brief Start to record video and audio to generate a mp4
  file.<br>开始录制视频和音频生成mp4文件。
  @param videoForm Input video stream.<br>输入的视频流。
  @param audioFroms Input audio streams list, will mix all audio streams in the
  list.<br>输入的音频流列表，混流所有音频流列表。
  @param url Record file path.<br>录制文件路径。
  @param onComplete Record complete call back.<br>录制完成回调。
*/
- (BOOL)startRecord:(nullable IRTCStream*)videoForm
         audioFroms:(nullable nullable NSMutableArray<IRTCStream*>*)audioFroms
                url:(NSURL*)url
         onComplete:(nullable void (^)(NSError*))onComplete;
/**
  @brief Update the record video source.<br>更新录制的视频源。
  @param videoForm Updated video stream.<br>更新的视频流。
*/
- (BOOL)updateVideoFrom:(nullable IRTCStream*)videoForm;
/**
  @brief Remove the record audio sources.<br>删除录制的音频源。
  @param audioFroms Removed audio streams list.<br>删除的音频流列表。
*/
- (BOOL)removeAudioFroms:
    (nullable nullable NSMutableArray<IRTCStream*>*)audioFroms;
/**
  @brief Add new audio sources to the record.<br>新增录制的音频源。
  @param audioFroms New added audio sources list to the
  record.<br>新增录制的音频源列表。
*/
- (BOOL)addAudioFroms:
    (nullable nullable NSMutableArray<IRTCStream*>*)audioFroms;
/**
  @brief Stop to record,and will generate a mp4
  file.<br>停止录制，将会产生一个mp4文件。
*/
- (BOOL)stopRecord;
@end
NS_ASSUME_NONNULL_END
#endif  // IRTC_BASE_OBJC_IRTCRECORDER_H_